package com.yyyzzz.servlet;

import com.yyyzzz.bean.StudentCourse;
import com.yyyzzz.service.impl.studentServiceimpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/courseServlet")
public class courseServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        studentServiceimpl service = new studentServiceimpl();
        List<StudentCourse> studentcourseList = service.getAllCourse();
        request.setAttribute("studentcourseList", studentcourseList);
        request.getRequestDispatcher("chooseCourse.jsp").forward(request, response);

    }


    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

    }
}
